﻿<%@ Page Language="C#" MasterPageFile="~/Admin/QuanLy.master" AutoEventWireup="true"
    CodeFile="QuanLyNhanVien.aspx.cs" Inherits="QuanLyNhanVien" Title="Quản lý nhân viên"
    Theme="Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="content_t">
        &nbsp;</div>
    <div id="content">
        <div align="center" id="list">
            <h3>
                Danh sách nhân viên</h3>
            <asp:GridView ID="GridView1" SkinID="GridView" runat="server" AutoGenerateColumns="False"
                OnRowCancelingEdit="GridView1_RowCancelingEdit" OnRowEditing="GridView1_RowEditing"
                OnRowUpdating="GridView1_RowUpdating" OnRowDeleting="GridView1_RowDeleting" OnPageIndexChanging="GridView1_PageIndexChanging"
                OnRowCommand="GridView1_RowCommand">
                <Columns>
                    <asp:TemplateField HeaderText="Tên nhân viên">
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("TenNV") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox1" TextMode="MultiLine" Width="60px" runat="server" Text='<%# Bind("TenNV") %>'
                                Rows="2"></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="CMND" HeaderText="CMND" ReadOnly="True">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Địa chỉ">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("DiaChi") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox2" TextMode="MultiLine" Width="100px" Rows="2" runat="server"
                                Text='<%# Bind("DiaChi") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Số điện thoại">
                        <ItemTemplate>
                            <asp:Label ID="Label3" runat="server" Text='<%# Bind("SoDienThoai") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox3" MaxLength="11" Rows="2" TextMode="MultiLine" Width="100"
                                runat="server" Text='<%# Bind("SoDienThoai") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email">
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("Email") %>'></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox CssClass="TextBox" ID="TextBox4" TextMode="MultiLine" Rows="2" runat="server" Text='<%# Bind("Email") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:CheckBoxField DataField="QuanLy" HeaderText="Quản lý">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CheckBoxField>
                    <asp:CheckBoxField DataField="KhongHoatDong" HeaderText="Không hoạt động">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CheckBoxField>
                    <asp:BoundField DataField="NgayVaoLam" HeaderText="Ngày vào làm" ReadOnly="True"
                        DataFormatString="{0:dd/MM/yyyy}" />
                    <asp:ButtonField ButtonType="Image" CommandName="Reset" HeaderText="Reset password"
                        ImageUrl="~/Images/reset.png">
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:ButtonField>
                    <asp:CommandField ShowEditButton="True" CancelText="Bỏ" DeleteText="Xóa" EditText="Sửa"
                        UpdateText="Sửa">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CommandField>
                    <asp:CommandField ShowDeleteButton="True" DeleteText="Xóa">
                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:CommandField>
                </Columns>
            </asp:GridView>
        </div>
        <div id="form" align="center">
            <asp:Table ID="tblThem" SkinID="Table" runat="server" Visible="False">
                <asp:TableHeaderRow SkinID="TableHeaderRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        Nhập thông tin nhân viên
                    </asp:TableHeaderCell>
                </asp:TableHeaderRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Tên nhân viên</asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtTen" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtTen"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Chứng minh nhân nhân</asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtCMND" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCMND"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Địa chỉ
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtDiaChi" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtDiaChi"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Điện thoại
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtDienThoai" runat="server" Width="200px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtDienThoai"
                            ErrorMessage="(*)"></asp:RequiredFieldValidator>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell">
                        Email
                    </asp:TableCell>
                    <asp:TableCell SkinID="TableCell">
                        <asp:TextBox CssClass="TextBox" ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>
                    <asp:TableCell SkinID="TableCell" HorizontalAlign="Center" ColumnSpan="2">
                        <asp:CheckBox ID="chkQuanLy" runat="server" Text="Quản lý" />
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableFooterRow SkinID="TableFooterRow">
                    <asp:TableHeaderCell ColumnSpan="2">
                        <asp:Button ID="btnLuu" runat="server" Text="Lưu" OnClick="btnLuu_Click" />
                        <asp:Button ID="btnHuy" runat="server" Text="Hủy" OnClick="btnHuy_Click" CausesValidation="False" />
                    </asp:TableHeaderCell>
                </asp:TableFooterRow>
            </asp:Table>
            <asp:Button ID="btnThem" runat="server" Text="Thêm nhân viên" OnClick="btnThem_Click"
                CausesValidation="False" />
        </div>
    </div>
    <div id="content_b">
        &nbsp;</div>
</asp:Content>
